const _ = require('lodash');

const reverse = arr => arr.reverse();
const first = arr => arr[0];
const toUpper = s => s.toUpperCase();

const f = _.flowRight(toUpper, first, reverse);
const f2 = _.flow(reverse, first, toUpper);

console.log(f(['a', 'b', 'c'])); // C
console.log(f2(['aa', 'bb', 'cc'])) // CC